package src; 

import java.awt.Color;

/**
 * The GamePiece class represents a "move" made on the game board in logic. The Game keeps track of which game pieces have been dropped at 
 * which locations to determine a winner. 
 * @author Akshat
 */
public class GamePiece 
{
	private Color color; 
	private GridLocation location;
	
	public GamePiece(Color c, GridLocation loc)
	{
		color = c; 
		location = loc; 
	}
	
	/**
	 * @return Color of this game piece
	 */
	public Color getColor()
	{
		return color; 
	}
	
	/**
	 * @return Location of this game piece
	 */
	public GridLocation getLocation()
	{
		return location; 
	}
	
	/**
	 * @param c which color to set the game piece as
	 */
	public void setColor(Color c)
	{
		color = c; 
	}

	/**
	 * @param obj object against which to compare gamepiece
	 */
	public boolean equals(Object obj)
	{
		GamePiece other = (GamePiece)obj; 
		if( color != null )
		{
			return (color.equals(other.getColor()));
		}
		
		return false;
	}
	
	
	
}
